package com.yudaxian.bi.model.enums;

/**
 * @Author: yudaxian
 * @Description: TODO
 * @DateTime: 2024/9/21 11:22
 **/
public enum ChartStatusEnum {
    WAITING(0, "等待"),
    PROCESSING(1, "处理中"),
    FINISHED(2, "已完成"),
    ERROR(3, "出错"),
    ;

    private Integer code;

    private String desc;

    ChartStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ChartStatusEnum getByCode(Integer code) {
        for (ChartStatusEnum chartStatusEnum : ChartStatusEnum.values()) {
            if (chartStatusEnum.getCode().equals(code)) {
                return chartStatusEnum;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
